/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * assign4
 * Copyright (C)  Michael 2008 <mikey.morckos@gmail.com>
 * 
 * assign4 is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * assign4 is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _Q4_H_
#define _Q4_H_

#include "img_wrapper.h" 

#include <iostream>
#include <gtkmm.h>
#include <gtkmm/button.h>
#include <gtkmm/main.h>

using namespace Gtk;
using namespace std;

const double PI = 3.141592654;

class Q4 : public Window {
	
    public:
	    Q4();
        virtual ~Q4();
		
	    void get_Homo();
	    void apply_Homo();

    private:
	    /* GTK */
	    VBox main_vbox_1, main_vbox_2; 
	    VBox frame1_vbox_1_1, frame1_vbox_1_2;
	    VBox frame2_vbox;	
	  
	    HBox main_hbox;
	    HBox frame1_hbox, hbox, hbox2;
	    HBox frame2_hbox_2_1, frame2_hbox_2_2;
		
	    Frame frame1, frame2;
		
        Button load_button, save_button;
	    Button button_1_1, button_1_2;
		
	    Entry entry1, entry2, entry3, entry4, entry5, entry6,
	          entry7, entry8, entry9, entry10;
		
	    Label label1, label2, label3, label4, label5, label6,
	          label7, label8, label9, label10;
		
	    /* ENGINE */
	    const char *name1, *name2;
	    IplImage *img1, *img2;
	    MY_Image img_data;
	    
	    int img_height, img_width;
	    int result_img_height, result_img_width;
	    
	    /* MATS DATA */
	    int res_width, res_height, tx, ty, tz; 
	    double alpha_u, alpha_v, pan, tilt, swing;
	    
	    /* MATRICES */
	    double A_arr [3] [3];
	    CvMat tmp_A;
	    CvMat* A;
	    
	    double R_arr [3] [3];
	    CvMat tmp_R;
	    CvMat* R;
	    
	    double Pan_arr [3] [3];
	    CvMat tmp_Pan;
	    CvMat* Pan;
	    
	    double Tilt_arr [3] [3];
	    CvMat tmp_Tilt;
	    CvMat* Tilt;
	    
	    double Swing_arr [3] [3];
	    CvMat tmp_Swing;
	    CvMat* Swing;
	    
	    double TMP_arr [3] [3];
	    CvMat tmp_TMP;
	    CvMat* TMP;
	    
	    double T_arr [3] [1];
	    CvMat tmp_T;
	    CvMat* T;
	    
	    double TMP2_arr [3] [1];
	    CvMat tmp_TMP2;
	    CvMat* TMP2;
	    
	    double Homo_arr [3] [3];
	    CvMat tmp_Homo;
	    CvMat* Homo;
	    
	    double Homo_arr_invert [3] [3];
	    CvMat tmp_Homo_invert;
	    CvMat* Homo_invert;
};

#endif // _Q4_H_

